The present invention relates to a data searching apparatus, and more particularly to a data searching apparatus for searching a record which meets a certain condition from records transferred to a data processing unit.
In a prior art method for searching a record based on the result of field-by-field comparison of records transferred from an external storage unit, such as a magnetic tape unit or a magnetic disc unit, to a data processing unit, the data read from the storage unit is stored in a buffer area of the main storage unit in the data processing unit through a channel and the records are fetched one at a time to an area of the main storage unit referred to by a program and the results are logically operated on by the program. In such a prior art method, however, the search speed is influenced by the instruction execution time of the processor which processes the program and a high speed processor is required to attain a high search speed. Such a high speed processor is usually expensive and hence has a low cost-performance.
In order to improve the search speed, a method has been proposed in which a data searching facility is imparted to a storage control unit. In this method, when field data is transferred from the storage unit to the storage control unit, the storage control unit compares the field data one field at a time with predetermined data and sets the results in latches. The latched data is logically operated on by a microprogram before the next data is transferred to check whether or not the respective records meet the search condition and a record which meets the search condition is processed.
In this method, however, in order for the microprogram processing to be executed within the time gap between the records, it is necessary to stop the transfer of the next record from the storage unit to the storage control unit or to set a gap passing time to be longer than the execution time of the microprogram. As a result, when a plurality of records are sequentially processed, the processing performance is lowered in proportion to the execution time of the microprogram. In addition, because of the presence of the gaps, the blocking of the records is not attained.
In order to allow the field-by-field comparison of the blocked records and the logical operation based on the comparison results without a time delay, a hardware execution without microprogram has been proposed. In this method, however, since undesired field data is also stored in the buffer memory in storing a compare-equal data, the utilization efficiency of the buffer memory is low and wasteful transfer time from the storage control unit to the channel is included because not only the desired fields but also other fields in the same record are stored in the buffer memory when the record meets the search condition.